package ctn.sdk.youdao.client;

import cnt.sdk.youdao.model.Translation;
import ctn.sdk.youdao.service.TranslateService;

public class YouDaoClient {
	private static YouDaoClient sInstance;
	
	private TranslateService translate;
	
	public YouDaoClient() {
		initDefaults();
	}


	private void initDefaults() {
		if(translate == null){
			translate = new TranslateService();
		}
	}


	public static YouDaoClient getInstance(){
		if(sInstance == null){
			sInstance = new YouDaoClient();
		}
		
		return sInstance;
	}
	
	public Translation translate(String query) throws Exception{
		return translate.translate(query);
	}
}
